<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
 <head>
  <meta http-equiv="content-type" content="text/html; charset=UTF-8">
  <title>Returns underlying output buffer associated with current buffer
  event</title>

 </head>
 <body><div class="manualnavbar" style="text-align: center;">
 <div class="prev" style="text-align: left; float: left;"><a href="eventbufferevent.getinput.html">EventBufferEvent::getInput</a></div>
 <div class="next" style="text-align: right; float: right;"><a href="eventbufferevent.read.html">EventBufferEvent::read</a></div>
 <div class="up"><a href="class.eventbufferevent.html">EventBufferEvent</a></div>
 <div class="home"><a href="index.html">PHP Manual</a></div>
</div><hr /><div id="eventbufferevent.getoutput" class="refentry">
 <div class="refnamediv">
  <h1 class="refname">EventBufferEvent::getOutput</h1>
  <p class="verinfo">(PECL event &gt;= 1.2.6-beta)</p><p class="refpurpose"><span class="refname">EventBufferEvent::getOutput</span> &mdash; <span class="dc-title">Returns underlying output buffer associated with current buffer
  event</span></p>

 </div>
 <div class="refsect1 description" id="refsect1-eventbufferevent.getoutput-description">
  <h3 class="title">说明</h3>
  <div class="methodsynopsis dc-description">
   <span class="modifier">public</span>
   <span class="type"><a href="class.eventbuffer.html" class="type EventBuffer">EventBuffer</a></span> 
   <span class="methodname"><strong>EventBufferEvent::getOutput</strong></span>
    ( <span class="methodparam">void</span>
   )</div>

  <p class="para rdfs-comment">
   Returns underlying output buffer associated with current buffer event. An
   output buffer is a storage for data to be written.
  </p>
  <p class="para">
   Note, there is also
   <em>
    <a href="class.eventbufferevent.html#eventbufferevent.props.output" class="link">output</a>
   </em>
   property of
   <a href="class.eventbufferevent.html" class="classname">EventBufferEvent</a>
   class.
  </p>
 </div>

 <div class="refsect1 parameters" id="refsect1-eventbufferevent.getoutput-parameters">
  <h3 class="title">参数</h3>
  <p class="para">此函数没有参数。</p>
 </div>

 <div class="refsect1 returnvalues" id="refsect1-eventbufferevent.getoutput-returnvalues">
  <h3 class="title">返回值</h3>
  <p class="para">
   Returns instance of
   <a href="class.eventbuffer.html" class="classname">EventBuffer</a>
   output buffer associated with current buffer event.
  </p>
 </div>

 <div class="refsect1 examples" id="refsect1-eventbufferevent.getoutput-examples">
  <h3 class="title">范例</h3>
  <div class="example" id="example-4164">
   <p><strong>Example #1 
    <span class="function"><strong>EventBufferEvent::getOutput()</strong></span> example</strong></p>
   <div class="example-contents">
<div class="phpcode"><code><span style="color: #000000">
<span style="color: #0000BB">&lt;?php<br />$base&nbsp;</span><span style="color: #007700">=&nbsp;new&nbsp;</span><span style="color: #0000BB">EventBase</span><span style="color: #007700">();<br /><br /></span><span style="color: #0000BB">$dns_base&nbsp;</span><span style="color: #007700">=&nbsp;new&nbsp;</span><span style="color: #0000BB">EventDnsBase</span><span style="color: #007700">(</span><span style="color: #0000BB">$base</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">TRUE</span><span style="color: #007700">);&nbsp;</span><span style="color: #FF8000">//&nbsp;Use&nbsp;async&nbsp;DNS&nbsp;resolving<br /></span><span style="color: #007700">if&nbsp;(!</span><span style="color: #0000BB">$dns_base</span><span style="color: #007700">)&nbsp;{<br />&nbsp;&nbsp;&nbsp;&nbsp;exit(</span><span style="color: #DD0000">"Failed&nbsp;to&nbsp;init&nbsp;DNS&nbsp;Base\n"</span><span style="color: #007700">);<br />}<br /><br /></span><span style="color: #0000BB">$bev&nbsp;</span><span style="color: #007700">=&nbsp;new&nbsp;</span><span style="color: #0000BB">EventBufferEvent</span><span style="color: #007700">(</span><span style="color: #0000BB">$base</span><span style="color: #007700">,&nbsp;</span><span style="color: #FF8000">/*&nbsp;use&nbsp;internal&nbsp;socket&nbsp;*/&nbsp;</span><span style="color: #0000BB">NULL</span><span style="color: #007700">,<br />&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000BB">EventBufferEvent</span><span style="color: #007700">::</span><span style="color: #0000BB">OPT_CLOSE_ON_FREE&nbsp;</span><span style="color: #007700">|&nbsp;</span><span style="color: #0000BB">EventBufferEvent</span><span style="color: #007700">::</span><span style="color: #0000BB">OPT_DEFER_CALLBACKS</span><span style="color: #007700">,<br />&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #DD0000">"readcb"</span><span style="color: #007700">,&nbsp;</span><span style="color: #FF8000">/*&nbsp;writecb&nbsp;*/&nbsp;</span><span style="color: #0000BB">NULL</span><span style="color: #007700">,&nbsp;</span><span style="color: #DD0000">"eventcb"</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">$base<br /></span><span style="color: #007700">);<br />if&nbsp;(!</span><span style="color: #0000BB">$bev</span><span style="color: #007700">)&nbsp;{<br />&nbsp;&nbsp;&nbsp;&nbsp;exit(</span><span style="color: #DD0000">"Failed&nbsp;creating&nbsp;bufferevent&nbsp;socket\n"</span><span style="color: #007700">);<br />}<br /><br /></span><span style="color: #0000BB">$bev</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">enable</span><span style="color: #007700">(</span><span style="color: #0000BB">Event</span><span style="color: #007700">::</span><span style="color: #0000BB">READ&nbsp;</span><span style="color: #007700">|&nbsp;</span><span style="color: #0000BB">Event</span><span style="color: #007700">::</span><span style="color: #0000BB">WRITE</span><span style="color: #007700">);<br /><br /></span><span style="color: #0000BB">$output&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #0000BB">$bev</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">getOutput</span><span style="color: #007700">();<br />if&nbsp;(!</span><span style="color: #0000BB">$output</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">add</span><span style="color: #007700">(<br />&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #DD0000">"GET&nbsp;</span><span style="color: #007700">{</span><span style="color: #0000BB">$argv</span><span style="color: #007700">[</span><span style="color: #0000BB">2</span><span style="color: #007700">]}</span><span style="color: #DD0000">&nbsp;HTTP/1.0\r\n"</span><span style="color: #007700">.<br />&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #DD0000">"Host:&nbsp;</span><span style="color: #007700">{</span><span style="color: #0000BB">$argv</span><span style="color: #007700">[</span><span style="color: #0000BB">1</span><span style="color: #007700">]}</span><span style="color: #DD0000">\r\n"</span><span style="color: #007700">.<br />&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #DD0000">"Connection:&nbsp;Close\r\n\r\n"<br /></span><span style="color: #007700">))&nbsp;{<br />&nbsp;&nbsp;&nbsp;&nbsp;exit(</span><span style="color: #DD0000">"Failed&nbsp;adding&nbsp;request&nbsp;to&nbsp;output&nbsp;buffer\n"</span><span style="color: #007700">);<br />}<br /><br /></span><span style="color: #FF8000">/*&nbsp;...&nbsp;*/<br /></span><span style="color: #0000BB">?&gt;</span>
</span>
</code></div>
   </div>

  </div>
 </div>

 <div class="refsect1 seealso" id="refsect1-eventbufferevent.getoutput-seealso">
  <h3 class="title">参见</h3>
  <ul class="simplelist">
   <li class="member">
    <span class="methodname"><a href="eventbufferevent.getinput.html" class="methodname" rel="rdfs-seeAlso">EventBufferEvent::getInput()</a> - Returns underlying input buffer associated with current buffer
  event</span>
   </li>
  </ul>
 </div>

</div><hr /><div class="manualnavbar" style="text-align: center;">
 <div class="prev" style="text-align: left; float: left;"><a href="eventbufferevent.getinput.html">EventBufferEvent::getInput</a></div>
 <div class="next" style="text-align: right; float: right;"><a href="eventbufferevent.read.html">EventBufferEvent::read</a></div>
 <div class="up"><a href="class.eventbufferevent.html">EventBufferEvent</a></div>
 <div class="home"><a href="index.html">PHP Manual</a></div>
</div></body></html>
